package com.xianxing.oauth2.service.impl;

import com.xianxing.oauth2.domain.User;
import com.xianxing.oauth2.service.UserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.xianxing.oauth2.mapper.UserMapper;
import tk.mybatis.mapper.entity.Example;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;


    @Override
    public User findByUsername(String username) {
        Example example = new Example(User.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("userName",username);
        return userMapper.selectOneByExample(example);
    }
}
